Given an unsorted Linked List, the task is to remove duplicates from the list....
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if the array is sorted in the reverse order, the inversion count is the maximum. Formally speaking, two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j Example:...
Given a Linked List. The Linked List is in alternating ascending and descending orders. Sort the list efficiently....
Merge sort is often preferred for sorting a linked list. The slow random-access performance of a linked list makes some other algorithms (such as quicksort) perform poorly, and others (such as heapsort) completely impossible....
Given K sorted linked lists of size N each, merge them and print the sorted output....
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if the array is sorted in the reverse order, the inversion count is the maximum. Formally speaking, two elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j Example:...
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order)....
Given a linked list that is sorted based on absolute values. Sort the list based on actual values.Examples:...
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the inversion count is 0, but if the array is sorted in reverse order, the inversion count is the maximum....
Given two linked lists sorted in increasing order. Merge them such a way that the result list is in decreasing order (reverse order)....
Given two Binary Search Trees(BST), print the inorder traversal of merged BSTs....
Given K sorted linked lists of size N each, merge them and print the sorted output....